Skip to contentSkip to conversation

Change in openvpn[master]: send uname() release as IV_PLAT_VER= on non-windows versions

Openvpn-devel In review cron2 (Code Review) 2 participants 10 messages Nov 3, 2024 – Nov 6, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1730665141000.Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/793?usp=email

to review the following change.

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

---
M src/openvpn/ssl.c
M src/openvpn/syshead.h

2 files changed, 8 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/1

src/openvpn/ssl.c +4 -0
index 8040e7b..8632832 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+	    struct utsname u;
+	    uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/793?usp=email

to look at the new patch set (#2).

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

---
M doc/man-sections/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h

3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/2

doc/man-sections/client-options.rst +4 -1
index a06948e..2f8d962 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will send the information
+        returned by the `uname(3)` system call, in the `release`
+        field.  Quite often this is the operation system kernel
+        version, but this is highly system specific.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..8632832 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+	    struct utsname u;
+	    uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/793?usp=email

to look at the new patch set (#3).

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments
v3: whitespace

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

---
M doc/man-sections/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h

3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/3

doc/man-sections/client-options.rst +4 -1
index a06948e..2f8d962 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will send the information
+        returned by the `uname(3)` system call, in the `release`
+        field.  Quite often this is the operation system kernel
+        version, but this is highly system specific.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..93e31f1 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+            struct utsname u;
+            uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 3
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, plaisthos.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/793?usp=email )

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

Patch Set 3: Code-Review+1

(3 comments)

Patchset:

PS3:
a few nit about the commit message, but patch looks good

File doc/man-sections/client-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/793/comment/9d2f23e6_9a5474d9 :
PS3, Line 435: field. Quite often this is the operation system kernel
s/operation/running ?

http://gerrit.openvpn.net/c/openvpn/+/793/comment/df21cbed_519010f8 :
PS3, Line 435: field. Quite often this is the operation system kernel
syscall manual is 2 - at least on my gentoo. man 3 uname leads to nothing

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 3
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 03 Nov 2024 20:56:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, ordex, plaisthos.

Hello flichtenheld, ordex, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/793?usp=email

to look at the new patch set (#4).

The following approvals got outdated and were removed:
Code-Review+1 by ordex

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments
v3: whitespace
v4: reword manpage

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

---
M doc/man-sections/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h

3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/4

doc/man-sections/client-options.rst +4 -1
index a06948e..5ca85e0 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will default to sending
+        the information returned by the `uname()` system call in
+        the `release` field, which is usually the currently running
+        kernel version.  This is highly system specific, though.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..93e31f1 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+            struct utsname u;
+            uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 4
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, plaisthos.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/793?usp=email )

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

Patch Set 4: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 4
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 04 Nov 2024 08:49:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#7 lore raw

PATCH v4 1/1 send uname() release as IV_PLAT_VER= on non-windows versions

In reply to a message not in the archive

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments
v3: whitespace
v4: reword manpage

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/793
This mail reflects revision 4 of this Change.

Acked-by according to Gerrit (reflected above):
Antonio Quartulli <[email protected]...>

doc/man-sections/client-options.rst +4 -1
index a06948e..5ca85e0 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will default to sending
+        the information returned by the `uname()` system call in
+        the `release` field, which is usually the currently running
+        kernel version.  This is highly system specific, though.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..93e31f1 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+            struct utsname u;
+            uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.
#8 lore raw

[Openvpn-devel] [PATCH applied] Re: send uname() release as IV_PLAT_VER= on non-windows versions

Thanks Antonio for the review.

Patch has been applied to the master and release/2.6 branch (localized mini-feature that can help admins keep track of macOS etc. client versions)

commit d5b4713153ce95e88651d93aa1ef25b2676d0cfc (master) commit f104d00af8ace124ff283e3adb7c7d4d867d6bbf (release/2.6)

Author: Gert Doering
Date:   Mon Nov 4 09:58:08 2024 +0100
     send uname() release as IV_PLAT_VER= on non-windows versions

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg29699.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#9 lore raw
In reply to a message not in the archive

Hello flichtenheld, ordex, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/793?usp=email

to look at the new patch set (#5).

The following approvals got outdated and were removed:
Code-Review+2 by ordex

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments
v3: whitespace
v4: reword manpage

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29699.html

---
M doc/man-sections/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h

3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/5

doc/man-sections/client-options.rst +4 -1
index a06948e..5ca85e0 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will default to sending
+        the information returned by the `uname()` system call in
+        the `release` field, which is usually the currently running
+        kernel version.  This is highly system specific, though.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..93e31f1 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+            struct utsname u;
+            uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 5
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#10 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/793?usp=email )

Change subject: send uname() release as IV_PLAT_VER= on non-windows versions
......................................................................

send uname() release as IV_PLAT_VER= on non-windows versions

This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says:

release Release level of the operating system

which translates to "IV_PLAT_VER=13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS.

It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do).

v2: manpage amendments
v3: whitespace
v4: reword manpage

Github: OpenVPN/openvpn#637

Change-Id Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29699.html

---
M doc/man-sections/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h

3 files changed, 12 insertions(+), 1 deletion(-)
doc/man-sections/client-options.rst +4 -1
index a06948e..5ca85e0 100644
@@ -430,7 +430,10 @@
         The version of the operating system, e.g. 6.1 for Windows 7.
         This may be set by the client UI/GUI using ``--setenv``.
         On Windows systems it is automatically determined by openvpn
-        itself.
+        itself.  On other platforms OpenVPN will default to sending
+        the information returned by the `uname()` system call in
+        the `release` field, which is usually the currently running
+        kernel version.  This is highly system specific, though.
 
   :code:`UV_<name>=<value>`
         Client environment variables whose names start with
src/openvpn/ssl.c +4 -0
index 8040e7b..93e31f1 100644
@@ -2010,6 +2010,10 @@
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n", win32_version_string(&gc, false));
+#else
+            struct utsname u;
+            uname(&u);
+            buf_printf(&out, "IV_PLAT_VER=%s\n", u.release);
 #endif
         }
 
src/openvpn/syshead.h +4 -0
index 83a48fc..33a90c1 100644
@@ -331,6 +331,10 @@
 #include <sys/mman.h>
 #endif
 
+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
 /*
  * Pedantic mode is meant to accomplish lint-style program checking,
  * not to build a working executable.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 5
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged